Repository navigation
Thread mpi hypre - #125
Merged
Merged
Thread mpi hypre#125
Conversation
nano-mpi allows one team of ranks per process, so solvers cannot each start their own. Add mpi_utils/RankTeam: the first acquire() starts the ranks with the calling thread as rank 0, the last release() joins them, and the driver hands work to the other ranks with dispatch() or run(). Idle workers sleep on a condition variable rather than waiting in an MPI collective, which spins in nano-mpi. CPUHybridSolver now uses it instead of its own team and command loop. Its commands and solver code are unchanged. This also drops the worker-side spdlog::set_level(off), which silenced every logger in the process. Turn on HYPRE_ENABLE_THREAD_LOCAL in MPI builds. The switch to upstream hypre left it off, so the rank threads shared hypre's global state, including the random seed used in coarsening. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove a duplicated `extern "C" {` that left a brace unclosed and broke every
CUDA build.
GPUHybridSolver is one rank on one GPU, but it created its hypre objects on
MPI_COMM_WORLD. While another solver holds the nano-mpi ranks, that world has
members that take no part in the solve, and hypre's collectives would hang.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In MPI builds, Hypre now splits the rows across the nano-mpi ranks (threads
of this process, via RankTeam) and solves in parallel. NANOMPI_NUM_RANKS sets
the number of ranks; the default is the number of cores. Row ranges are made
of whole blocks so that no node is split between ranks. A solver used from a
thread that cannot drive the ranks solves on that thread alone.
"Hypre": {"use_gpu": true} runs hypre on the current CUDA device as a single
rank, with the same AMG options as GPUHybridSolver. It needs
POLYSOLVE_WITH_CUDA; otherwise set_parameters throws. Nodal coarsening has no
GPU implementation in hypre and is ignored there with a warning.
hypre's memory location and execution policy are now set around each call
instead of once in the constructor, so solvers on the same thread no longer
override each other's settings. interp_rbms is ignored with a warning: it
needs node positions the solver is never given, and was passing hypre empty
vectors.
Adds tests for several rank counts, more ranks than rows, use from another
thread, Hypre and CPUHybrid sharing the ranks, and the GPU option, and has CI
check Hypre's convergence at 1, 2 and 4 ranks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
==========================================
+ Coverage 78.37% 78.89% +0.52%
==========================================
Files 55 56 +1
Lines 2996 3127 +131
Branches 387 399 +12
==========================================
+ Hits 2348 2467 +119
- Misses 648 660 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
teseoch
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.